package com.dodoke.cake.service.impl;



import com.dodoke.cake.bean.CakeProduct;
import com.dodoke.cake.dao.ProductListDao;
import com.dodoke.cake.service.ProductListService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductListServiceImpl implements ProductListService {
	@Autowired
	private ProductListDao pl ;


	@Override
	public void deleteCake(int id) {
		this.pl.deleteCake(id);
	}

	@Override
	public CakeProduct getCakeInfo(@Param("id") int id) {
		return this.pl.getCakeInfo(id);
	}

	@Override
	public int getAllProductCount() {
		return this.pl.getAllProductCount();
	}

	@Override
	public List<CakeProduct> getCurrentPageData(int fromWhichPage, int eachPageData) {
		return this.pl.getCurrentPageData(fromWhichPage, eachPageData);
	}

	@Override
	public int deleteCakeProductById(int id) {
		return this.pl.deleteCakeProductById(id);
	}



	@Override
	public void upCakeProduct(CakeProduct cp) {
		 this.pl.upCakeProduct(cp);
	}

	@Override
	public List<CakeProduct> selectAll() {
		return this.pl.selectAll();
	}

	@Override
	public void insertCake(CakeProduct cakeProduct) {
		this.pl.insertCake(cakeProduct);
	}

	@Override
	public List<CakeProduct> getRecommentProduct() {
		return this.pl.getRecommentProduct();
	}

	@Override
	public List<CakeProduct> getBestSellProduct() {
		return this.pl.getBestSellProduct();
	}

	@Override
	public int getCakeNumByCatalogId(int cid) {
		return this.pl.getCakeNumByCatalogId(cid);
	}

	@Override
	public List<CakeProduct> getProductByCid(int cid, int fromWhichData, int eachPageData) {
		return this.pl.getProductByCid(cid, fromWhichData, eachPageData);
	}

}
